package com.code.zjm.demo.ui;

import android.content.Context;
import android.content.Intent;

/**
 * Created by ZJM on 2017/3/3.
 */

public class ListCellData {
    private Context mainContent;
    private String componentName;
    private Intent relativeIntent;

    public ListCellData(Context mainContent, String componentName, Intent relativeIntent) {
        this.mainContent = mainContent;
        this.componentName = componentName;
        this.relativeIntent = relativeIntent;
    }

    public Context getMainContent() {
        return mainContent;
    }

    public void setMainContent(Context mainContent) {
        this.mainContent = mainContent;
    }

    public String getComponentName() {
        return componentName;
    }

    public void setComponentName(String componentName) {
        this.componentName = componentName;
    }

    public Intent getRelativeIntent() {
        return relativeIntent;
    }

    public void setRelativeIntent(Intent relativeIntent) {
        this.relativeIntent = relativeIntent;
    }

    public void startActivity() {
        mainContent.startActivity(getRelativeIntent());
    }

    @Override
    public String toString() {
        return getComponentName();
    }
}
